home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9714 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: malloc question
  5. Date: Tue, 12 Mar 96 21:45:47 GMT
  6. Organization: none
  7. Distribution: world
  8. Message-ID: <826667147snz@genesis.demon.co.uk>
  9. References: <4htonk$350@news.hklink.net> <danpop.826488975@rscernix> <4i44vk$g16@rigel.rz.uni-ulm.de>
  10. Reply-To: fred@genesis.demon.co.uk
  11. X-NNTP-Posting-Host: genesis.demon.co.uk
  12. X-Newsreader: Demon Internet Simple News v1.27
  13. X-Mail2News-Path: genesis.demon.co.uk
  14.  
  15. In article <4i44vk$g16@rigel.rz.uni-ulm.de>
  16.            peinel@faw.uni-ulm.de "Gertraud Peinel" writes:
  17.  
  18. >Hmmm, and what should I do with this (especially when I have to use these
  19. >compilers) ? :
  20.  
  21. ...
  22.  
  23. >  main()
  24. >  {
  25. >    PITEM head, current;
  26. >    head= malloc(sizeof(ITEM));
  27. >    head->val=1;
  28. >  }
  29. >  sun5:/users/peinel/clang(29)> cc oh.c
  30. >  "oh.c", line 11: warning: illegal pointer combination
  31.  
  32. Complain to your vendor if they can't supply you with a compiler that conforms
  33. to a 7 year old standard, or install gcc. There is really no excuse to write
  34. C code on current or recent production platforms that doesn't use the full
  35. benefits of the ANSI language.
  36.  
  37. >  sun5:/users/peinel/clang(32)> CC oh.c
  38. >  CC  mist.c:
  39. >  "oh.c", line 11: error: no standard conversion of  char * to  struct item *
  40. >  "oh.c", line 10: warning:  current not used
  41. >  1 error
  42. >  sun5:/users/peinel/clang(33)> which CC
  43. >  /com/owc++/bin/CC
  44.  
  45. If you're writing in C++ you make use of the facilities provided by *that*
  46. language i.e. you don't use malloc or void *
  47.  
  48. -- 
  49. -----------------------------------------
  50. Lawrence Kirby | fred@genesis.demon.co.uk
  51. Wilts, England | 70734.126@compuserve.com
  52. -----------------------------------------
  53.